home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / Include / FWDialog.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  3.9 KB  |  146 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                DlogFrm.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWDIALOG_H
  11. #define FWDIALOG_H
  12.  
  13. // ----- Framework Includes -----
  14.  
  15. #ifndef FWFRAME_H
  16. #include "FWFrame.h"
  17. #endif
  18.  
  19. #ifndef FWEVENT_H
  20. #include "FWEvent.h"
  21. #endif
  22.  
  23. #ifndef FWBUTTON_H
  24. #include "FWButton.h"
  25. #endif
  26.  
  27. #ifndef FWWINDOW_K
  28. #include "FWWindow.k"
  29. #endif
  30.  
  31. // ----- Foundation Layer -----
  32.  
  33. #ifndef FWRECEVR_H
  34. #include "FWRecevr.h"
  35. #endif
  36.  
  37. //==============================================================================
  38. // Forward Declarations
  39. //==============================================================================
  40.  
  41. class FW_CNotification;
  42. class FW_CIdler;
  43. class FW_CView;
  44. class FW_CViewTabber;
  45. class FW_CButton;
  46. class FW_CVirtualKeyEvent;
  47.  
  48. //==============================================================================
  49. // class FW_CDialogFrame 
  50. //==============================================================================
  51.  
  52. class FW_CDialogFrame : public FW_CFrame, public FW_MReceiver
  53. {
  54.  
  55. //----------------------------------------------------------------------------------------
  56. //    Initialization/Destruction
  57. //
  58.   public:
  59.     FW_DECLARE_CLASS
  60.     FW_DECLARE_AUTO(FW_CDialogFrame)
  61.  
  62.     FW_CDialogFrame(Environment* ev, 
  63.                     ODFrame* odFrame, 
  64.                     FW_CPresentation* presentation, 
  65.                     FW_CPart* part,
  66.                     FW_ResourceId id = 0);
  67.  
  68.     virtual ~FW_CDialogFrame();
  69.     
  70. //----------------------------------------------------------------------------------------
  71. //    Inherited API
  72. //
  73.     virtual void         HandleNotification(Environment* ev, const FW_CNotification& notification);
  74.  
  75.     virtual void         FrameRemoved(Environment* ev, FW_Boolean toStorage);
  76.     virtual FW_Boolean    DoVirtualKey (Environment* ev, const FW_CVirtualKeyEvent & event);
  77.  
  78. //----------------------------------------------------------------------------------------
  79. //    New API
  80. //
  81.   public:
  82.       // ---- Dialog creation
  83.     static FW_CDialogFrame* NewModalDialog(Environment* ev, 
  84.                                     FW_CPart* part, 
  85.                                     FW_CPresentation* presentation,
  86.                                     const FW_CPoint& size, 
  87.                                     const FW_CPoint& position, 
  88.                                     FW_WindowStyle style, 
  89.                                     const FW_CString& windowTitle);
  90.       
  91.     static FW_CDialogFrame* NewAndShowModalDialog(Environment* ev, 
  92.                                     FW_CPart* part, 
  93.                                     FW_CPresentation* presentation,
  94.                                     const FW_CPoint& size, 
  95.                                     const FW_CPoint& position, 
  96.                                     FW_WindowStyle style, 
  97.                                     const FW_CString& windowTitle);
  98.   public:
  99.      // ---- OK/Cancel buttons
  100.     FW_CButton*            GetDefaultButton(Environment* ev) const;
  101.     FW_CButton*            GetCancelButton(Environment* ev) const;
  102.     void                SetDefaultButton(Environment* ev, ODID id);
  103.     void                SetCancelButton(Environment* ev, ODID id);
  104.     
  105.   private:
  106.     FW_Boolean             TryModalFocus(Environment* ev, ODFrame* odFrame, FW_Boolean isMoveable);
  107.  
  108. //----------------------------------------------------------------------------------------
  109. //    Private Implementation
  110. //
  111. public:
  112.     virtual void        PrivButtonAttached(Environment* ev, FW_CButton* button);
  113.  
  114.     FW_CButton*            PrivSetDismissButton(Environment* ev, 
  115.                             FW_CButton* newButton, 
  116.                             FW_Message message, 
  117.                             FW_CButton* prevButton);
  118.  
  119. //----------------------------------------------------------------------------------------
  120. //    Data Members
  121. //
  122.   private:
  123.     FW_Boolean            fIsModal;
  124.     FW_CIdler*            fIdler;
  125.     FW_CViewTabber*        fViewTabber;
  126.     FW_CButton*            fDefaultButton;
  127.     FW_CButton*            fCancelButton;
  128. };
  129.  
  130. //==============================================================================
  131. // FW_CDialogFrame Inlines
  132. //==============================================================================
  133.  
  134. inline FW_CButton* FW_CDialogFrame::GetDefaultButton(Environment*) const
  135. {
  136.     return fDefaultButton;
  137. }
  138.  
  139. inline FW_CButton* FW_CDialogFrame::GetCancelButton(Environment*) const
  140. {
  141.     return fCancelButton;
  142. }
  143.  
  144.  
  145. #endif
  146.